<include file='Public/header' />
<style>
	#content{
		folat:left;
		width:90%;
		margin-left:2%;
	}
	#left{
		float:left;
		width:420px;
		border-radius:2px;
		border:1px solid grey;
		margin-left:2%;
	}
	#right{
		border-radius:2px;
		border:1px solid grey;
		height:400px;
		margin-left:440px;
	}
	#pf{
		width:50%;
		margin-left:25%;
		font-size:30px;
	}
	#intro{
		width:90%;
		margin-left:5%;
	}
	#jqjj{
		width:50%;
		margin-left:35%;
	}
	#message_content{
		width: 90%;
	    margin-left: 10%
	}
	#message_title{
		width:50%;
		margin-left:36.5%;
	}
	.messagebox{
		width: 90%;
		margin-left:5%;
	}
    .usermessage{
    	width:40%;
    	float:right;
    }
	#fbly{
		width:90%;
		margin-left: 5%;
	}
	#fbutton{
		float:right;
		margin-right:2%;
	}
     #footer{
			width:100%;
			text-align:center;
	   }
	  #mainbody{
		width:80%;
		margin-left:10%;
	  }
	  #rtop{
		width:100%;
		font-size:25px;
	  }
	  #rintro{
		margin-left:10px;
		font-size:20px;
		color:red;
		height:80px;
	  }
	  #pfen{
		font-size:20px;
		color:green;
		margin-left:20px;
	  }
	  #fprice{
		margin-left:20px;
		font-size:35px;
		color:red;
	  }
	  #price{
		margin-left:20px;
		height:120px;
	  }
	  #some{
		width:100%;
	  }
	  #saled{
		margin-left:10px;
	  }
	  #have{
		margin-left:300px;
	  }
	  .btn-car{
			border-radius:5px;
			background-color:red;
			width:120px;
			height:40px;
			margin-left:10px;
		}
		.min{
			margin-left:10px;
			border-radius:5px;
			background-color:white;
			width:30px;
		}
		.add{
			border-radius:5px;
			background-color:white;
			width:30px;
		}
		.btn-car:hover{
			background-color:pink;
			border:1px green solid;
		}
	  #shoppingcar-block{
			position:fixed;
			top:40%;
			right:20px;
			left: 91%;
			width:6%;
			height:200px;
			
			text-align:center;
			color:grey;
		}
		#displayshopcar{
			position:fixed;
			top:180px;
			right:120px;
			width:300px;
			height:380px;
			background-color:white;
			border:3px solid grey;
			border-radius:5px;
			display:none;
			overflow-y:auto;
		
		}
		#displayshopcar-top{
			background-color:grey;
			width:100%;
			height:70px;
		}
		#exit{
			margin-left:5px;
			font-size:15px;
			width:50px;
		}
		#jiesuan{
			width:50%;
			font-size:20px;
			margin-left:25%;
			font-color:green;
			background-color:green;
		}
		#jiesuan:hover{
			font-color:green;
			background-color:blue;
		}
		.cargoods{
			width:100%;
			height:80px;
			border:1px solid green;
			border-radius:3px;
		}
		.cp{
			width:30%;
			float:left;
		}
		.sprice{
			float:left;
			width:40%;
		}
		#bodycontent{
			width:100%;
		}
		#biaoti{
			width:100%;
			height:40px;
			font-size:0px;
		}
		#bxiangqing{
			display:-moz-inline-box; display:inline-block; 
			width:150px;
			height:30px;
			text-align:center;
			line-height:30px;
			font-size:20px;
			border:solid 1px grey;
		}
		#bxiangqing:hover{		
			color:red;
			cursor:pointer;
		}
		#bpinglun{
			display:-moz-inline-box; display:inline-block; 
			width:150px;
			height:30px;
			text-align:center;
			line-height:30px;
			border:solid 1px grey;
			margin-left:0px;
			font-size:20px;
		}
		#bpinglun:hover{		
			color:red;
			cursor:pointer;
		}
		#xiangqing{
			width:100%;
		}
		#pinglun{
			width:100%;
			display:none;
		}
		.plr{
			margin-left:70%;
		}
</style>
<script>
	//切换
	function xiangqingclick(b1,b2){
		va1=document.getElementById(b1);
		va2=document.getElementById(b2);
		va2.style.display="none";
		va1.style.display="block";
	}
</script>	
	<?php
		$picpath=str_replace("thumb_","",$good[0]['pic']);
	?>
	<div id="mainbody">
	 <ol class="breadcrumb">
		<li><a href="{:U('Index/index')}">首页</a></li>
		<li><a href="{:U('List/Index',array('id'=>$cid,'name'=>$cname,'mode'=>'id','dec'=>'desc'))}">{$good[0]['cname']}</a></li>
		<li class="active"><a href="{:U('List/showgood',array('id'=>$good[0]['id'],'cid'=>$cid,'cname'=>$cname))}">{$good[0]['name']}</a></li>
	</ol>
	<div id="content">
		<div id="left">
			<image id="imgpic" src="__PUBLIC__/photo/{$picpath}" width="400px">	
		</div>
		<div id="right">
		<div id="rtop">【格林农场】{$good[0]['name']}</div>
		<div id="rintro">{$good[0]['lintro']}</div>
		<div id="price">价格：<span id="fprice">￥{$good[0]['price']}元/{$good[0]['danwei']}</span></div>
		<div id="pfen">
			<?php
				if($score)  echo "评分:     ".$score;
			?>
		</div>
			<div class="shop">
				<input class="min" name="" type="button" value="-" onclick="javascript:butjian(this)"/>
				<input class="text_box" name="goodnum" type="text" value="1" style="width:25px;" />
				<input class="add" name="" type="button" onclick="javascript:butjia(this)" value="+" />
				<hr>								
				<input name="" type="hidden"  value="{$good[0]['id']}" />
				<input name="" type="hidden"  value="{$good[0]['danwei']}" />
				<input name="" type="hidden"  value="{$picpath}" />
				<input name="" type="hidden"  value="{$good[0]['price']}" />
				<input name="" type="hidden"  value="{$good[0]['name']}" />
				<button type="submit" class="btn-car" onclick="javascript:addGoods(this)" ><span class="glyphicon glyphicon-shopping-cart"></span>加入购物车</button>
			</div>
		<div id="some"><span id="saled">已售出:{$good[0]['sum']}份</span><span id="have">库存:{$good[0]['kucun']}份</span></div>
		
		</div>
	</div><!--content-->
	<hr>
	<div id="bodycontent">
		<div id="biaoti">
			<span id="bxiangqing" onclick="xiangqingclick('xiangqing','pinglun')">
				商品详情
			</span>
			<span id="bpinglun" onclick="xiangqingclick('pinglun','xiangqing')">
				购买评论({$pnum})
			</span>
		</div>
		<hr width="100%" style="margin-top:-5px;border:1px solid green;">
		<div id="xiangqing">
			<?php   echo html_entity_decode($good[0]['intro']);?>
		</div><!--xiangqing-->
		<div id="pinglun">
			<volist name="meslist" id="vo">
				<div class='pl'><!--评论主体-->
					<span class='pll'>
						<p>{$vo.content}</p>
						{$vo.star}分
					</span><span class='plr'>
					{$vo.uname} || {$vo.pdate}</span>
				</div>
				<hr>
			</volist>
			<div class="text-center">
				<ul class="pagination">{$page}</ul>
			</div>
		</div><!--pinglun-->
	</div><!--bodycontent-->
</div><!--mainbody-->
	<div id="displayshopcar">
	<form method="POST" action="{:U('Pay/index')}">
		<div id="displayshopcar-top">
			<a id="exit" href="javascript:hidden('displayshopcar')">X</a><br>
			<input id="jiesuan" type="submit" value="￥去结算">
		</div>
		<div>总量：<span id="allnum">
		<?php if(isset($_COOKIE['badge'])) echo $_COOKIE['badge']; else echo "0";?>
		</span>总价：<span id="allprice">
		<?php if(isset($_COOKIE['allprice'])) echo $_COOKIE['allprice'];else echo "0";?></span>元</div>
		<hr>
		<div id="goods">
			<?php if(isset($_COOKIE['content'])) echo unescape($_COOKIE['content']);?>
		</div>
		</form>
	</div>
	<div id="shoppingcar-block">
		<a href="javascript:show('displayshopcar')">
			<span class="badge" id="badge"><?php if(isset($_COOKIE['badge'])) echo $_COOKIE['badge']; else echo "0";?></span><img src="__PUBLIC__/assest/image/shopcar.png" width="100%">
		</a>
		<p>购物车</p>
		<hr>
	</div><!--shoppingcar-block-->
<include file='Public/footer'/>
